
import { createRoot } from 'react-dom/client'
import './index.css'
import { Suspense } from 'react'
import { RouterProvider } from 'react-router-dom'
import router from './Router'
import { store } from './store/store'
import { Provider } from 'react-redux'
import { initUserInfo } from './store/Info'

// 在应用启动时初始化用户信息
store.dispatch(initUserInfo())

createRoot(document.getElementById('root')!).render(
  <Provider store={store}>
    <Suspense fallback={<div>Loading...</div>}>
      <RouterProvider router={router} />
    </Suspense>
  </Provider>
)
